package org.oos.dao.impl;

import static org.oos.ApiUrlProvider.UserCheckin;

import org.oos.atom.CheckinFeed;
import org.oos.atom.entries.CheckinEntry;
import org.oos.atom.entries.impl.CheckinEntryImpl;
import org.oos.atom.impl.CheckinFeedImpl;
import org.oos.dao.UserCheckinDao;
import org.oos.dao.lists.impl.ReadOnlyDynamicList;

import com.google.api.client.http.GenericUrl;

/**
 * 
 * Checkin DAO
 * 
 * @author pablo.gonzalez@11870.com
 * 
 */
public class UserCheckinDaoImpl extends
		AbstractDao<CheckinEntry, CheckinFeed<CheckinEntry>> implements
		UserCheckinDao {
	
	private String userSlug;

	public UserCheckinDaoImpl() {
		super(CheckinFeedImpl.class, CheckinEntryImpl.class);
	}

	@Override
	public GenericUrl getFeedUrl() {
		return UserCheckin.getUrl(userSlug);
	}

	@SuppressWarnings("unchecked")
	@Override
	protected ReadOnlyDynamicList<CheckinEntry, CheckinFeed<CheckinEntry>> getList(CheckinFeed feed) {
		return new ReadOnlyDynamicList<CheckinEntry, CheckinFeed<CheckinEntry>>(this, feed);
	}
	
	@Override
	public void setUserSlug(String userSlug) {
		this.userSlug = userSlug;
	}

}
